use reinterpret_cast with queues.
authortsteven4 <tsteven4@gmail.com>
Sat, 14 Jul 2018 23:01:41 +0000 (17:01 -0600)
committertsteven4 <tsteven4@gmail.com>
Sat, 14 Jul 2018 23:01:41 +0000 (17:01 -0600)
41 files changed:
arcdist.cc
bcr.cc
bend.cc
csv_util.cc
defs.h
duplicate.cc
exif.cc
garmin.cc
garmin_gpi.cc
gdb.cc
ggv_log.cc
ggv_ovl.cc
gpx.cc
gtm.cc
igc.cc
inifile.cc
interpolate.cc
kml.cc
lowranceusr4.cc
magproto.cc
mapasia.cc
mapsource.cc
mkshort.cc
mmo.cc
netstumbler.cc
nmea.cc
pocketfms_fp.cc
polygon.cc
position.cc
radius.cc
route.cc
session.cc
sort.cc
stackfilter.cc
stmsdf.cc
tomtom.cc
tpo.cc
trackfilter.cc
transform.cc
waypt.cc
xcsv.cc

index 098b69c489bb8ac8347446c23e9cab5525db5f98..e929b10ec0d987e2a83aadaddc08257d9c3b57b9 100644 (file)
@@ -158,7 +158,7 @@ void ArcDistanceFilter::process()
   foreach (Waypoint* wp, waypt_list) {
 #else
   QUEUE_FOR_EACH(&waypt_head, elem, tmp) {
-    Waypoint* wp = (Waypoint*) elem;
+    Waypoint* wp = reinterpret_cast<Waypoint *>(elem);
 #endif
     extra_data* ed = (extra_data*) wp->extra_data;
     wp->extra_data = nullptr;
diff --git a/bcr.cc b/bcr.cc
index ce1e611674f3911f88d0cc33b3c2ef3ef2e83787..5673327c5eacc5568f74807651eeb86d6fd33beb 100644 (file)
--- a/bcr.cc
+++ b/bcr.cc
@@ -207,7 +207,7 @@ bcr_create_waypts_from_route(route_head* route)
   queue* elem, *tmp;
 
   QUEUE_FOR_EACH(&route->waypoint_list, elem, tmp) {
-    Waypoint* wpt = new Waypoint(*(Waypoint*) elem);
+    Waypoint* wpt = new Waypoint(*reinterpret_cast<Waypoint *>(elem));
     waypt_add(wpt);
   }
 }
@@ -385,7 +385,7 @@ bcr_route_header(const route_head* route)
 
   int i = 0;
   QUEUE_FOR_EACH(&route->waypoint_list, elem, tmp) {
-    Waypoint* wpt = (Waypoint*) elem;
+    Waypoint* wpt = reinterpret_cast<Waypoint *>(elem);
 
     i++;
 
@@ -403,7 +403,7 @@ bcr_route_header(const route_head* route)
   i = 0;
   QUEUE_FOR_EACH(&route->waypoint_list, elem, tmp) {
     i++;
-    wpt = (Waypoint*) elem;
+    wpt = reinterpret_cast<Waypoint *>(elem);
 
     bcr_wgs84_to_mercator(wpt->latitude, wpt->longitude, &north, &east);
 
@@ -431,7 +431,7 @@ bcr_route_header(const route_head* route)
     QString s2;
 
     i++;
-    wpt = (Waypoint*) elem;
+    wpt = reinterpret_cast<Waypoint *>(elem);
     QString s1 = wpt->notes;
     if (s1.isEmpty()) {
       s1 = wpt->description;
diff --git a/bend.cc b/bend.cc
index f70f392b9d519e48df8bfb7ef476734d4c2a983e..38c2e04568250bd9350a1225e3dd8eb648274e4d 100644 (file)
--- a/bend.cc
+++ b/bend.cc
@@ -95,7 +95,7 @@ void BendFilter::process_route(const route_head* route_orig, route_head* route_d
 
   queue* elem, *tmp;
   QUEUE_FOR_EACH(&route_orig->waypoint_list, elem, tmp) {
-    Waypoint* wpt_orig_next = (Waypoint*)elem;
+    Waypoint* wpt_orig_next = reinterpret_cast<Waypoint *>(elem);
 
     if (wpt_orig_prev == nullptr) {
       if (wpt_orig != nullptr) {
@@ -160,7 +160,7 @@ void BendFilter::process()
 {
   queue* elem, *tmp;
   QUEUE_FOR_EACH(routes_orig, elem, tmp) {
-    route_head* route_orig = (route_head*)elem;
+    route_head* route_orig = reinterpret_cast<route_head *>(elem);
     process_route_orig(route_orig);
   }
 }
index b01a2bcb429575360ffa7c6fb96e25a5f2f709ce..177105a70d17f30248c6e5c57504d5e8d98cde94 100644 (file)
@@ -1471,7 +1471,7 @@ xcsv_data_read(void)
        * off the beginning of buff since there's no index into queue.
        */
       while (s) {
-        field_map_t* fmp = (field_map_t*) elem;
+        field_map_t* fmp = reinterpret_cast<field_map_t *>(elem);
         xcsv_parse_val(s, wpt_tmp, fmp, &trk);
 
         elem = QUEUE_NEXT(elem);
@@ -1632,7 +1632,7 @@ xcsv_waypt_pr(const Waypoint* wpt)
      */
     int field_is_unknown = 0;
 
-    field_map_t* fmp = (field_map_t*) elem;
+    field_map_t* fmp = reinterpret_cast<field_map_t *>(elem);
 
     if ((i != 0) && !(fmp->options & OPTIONS_NODELIM)) {
       *xcsv_file.stream << write_delimiter;
diff --git a/defs.h b/defs.h
index b3e48a866c3ea0e2928ec4ff981168963297a18b..f2955ec1b415710d2aafaefaf4355d24df148dfd 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -605,7 +605,7 @@ waypt_disp_session(const session_t* se, T cb)
 #else
   queue* elem, *tmp;
   QUEUE_FOR_EACH(&waypt_head, elem, tmp) {
-    Waypoint* waypointp = (Waypoint*) elem;
+    Waypoint* waypointp = reinterpret_cast<Waypoint *>(elem);
 #endif
     if ((se == nullptr) || (waypointp->session == se)) {
       if (global_opts.verbose_status) {
@@ -717,7 +717,7 @@ route_disp(const route_head* rh, T cb)
 // cb != nullptr, caught with an overload of route_disp
   QUEUE_FOR_EACH(&rh->waypoint_list, elem, tmp) {
     Waypoint* waypointp;
-    waypointp = (Waypoint*) elem;
+    waypointp = reinterpret_cast<Waypoint *>(elem);
     cb(waypointp);
   }
 }
@@ -729,7 +729,7 @@ common_disp_all(queue* qh, T1 rh, T2 rt, T3 wc)
   queue* elem, *tmp;
   QUEUE_FOR_EACH(qh, elem, tmp) {
     const route_head* rhp;
-    rhp = (route_head*) elem;
+    rhp = reinterpret_cast<route_head *>(elem);
 // rh != nullptr, caught with an overload of common_disp_all
     rh(rhp);
     route_disp(rhp, wc);
@@ -745,7 +745,7 @@ common_disp_all(queue* qh, std::nullptr_t /* rh */, T2 rt, T3 wc)
   queue* elem, *tmp;
   QUEUE_FOR_EACH(qh, elem, tmp) {
     const route_head* rhp;
-    rhp = (route_head*) elem;
+    rhp = reinterpret_cast<route_head *>(elem);
 // rh == nullptr
     route_disp(rhp, wc);
 // rt != nullptr, caught with an overload of common_disp_all
@@ -760,7 +760,7 @@ common_disp_all(queue* qh, T1 rh, std::nullptr_t /* rt */, T3 wc)
   queue* elem, *tmp;
   QUEUE_FOR_EACH(qh, elem, tmp) {
     const route_head* rhp;
-    rhp = (route_head*) elem;
+    rhp = reinterpret_cast<route_head *>(elem);
 // rh != nullptr, caught with an overload of common_disp_all
     rh(rhp);
     route_disp(rhp, wc);
@@ -775,7 +775,7 @@ common_disp_all(queue* qh, std::nullptr_t /* rh */, std::nullptr_t /* rt */, T3
   queue* elem, *tmp;
   QUEUE_FOR_EACH(qh, elem, tmp) {
     const route_head* rhp;
-    rhp = (route_head*) elem;
+    rhp = reinterpret_cast<route_head *>(elem);
 // rh == nullptr
     route_disp(rhp, wc);
 // rt == nullptr
index 6db106098129a107de634f0d4e1a68d6304ca070..41ddf99a5eccfc944258ad7ac00e376f1dcfb66d 100644 (file)
@@ -156,7 +156,7 @@ void DuplicateFilter::process(void)
     bh->wpt = waypointp;
 #else
   QUEUE_FOR_EACH(&waypt_head, elem, tmp) {
-    bh->wpt = (Waypoint*) elem;
+    bh->wpt = reinterpret_cast<Waypoint *>(elem);
 #endif
     bh->index = i;
     i ++;
diff --git a/exif.cc b/exif.cc
index a31220b415b85a17af6f343579bd4ebfdb5c4b2a..677e2f34f0db782fecce628e6c1105441742303b 100644 (file)
--- a/exif.cc
+++ b/exif.cc
@@ -310,7 +310,7 @@ exif_release_ifd(exif_ifd_t* ifd)
     queue* elem, *tmp;
 
     QUEUE_FOR_EACH(&ifd->tags, elem, tmp) {
-      exif_release_tag((exif_tag_t*)elem);
+      exif_release_tag(reinterpret_cast<exif_tag_t *>(elem));
     }
     xfree(ifd);
   }
@@ -323,7 +323,7 @@ exif_release_apps()
 
   QUEUE_FOR_EACH(&exif_apps, e0, t0) {
     queue* e1, *t1;
-    exif_app_t* app = (exif_app_t*)dequeue(e0);
+    exif_app_t* app = reinterpret_cast<exif_app_t *>(dequeue(e0));
 
     if (app->fcache) {
       gbfclose(app->fcache);
@@ -332,7 +332,7 @@ exif_release_apps()
       gbfclose(app->fexif);
     }
     QUEUE_FOR_EACH(&app->ifds, e1, t1) {
-      exif_ifd_t* ifd = (exif_ifd_t*)dequeue(e1);
+      exif_ifd_t* ifd = reinterpret_cast<exif_ifd_t *>(dequeue(e1));
       exif_release_ifd(ifd);
     }
     xfree(app);
@@ -347,7 +347,7 @@ exif_ifd_size(exif_ifd_t* ifd)
 
   res += (ifd->count * 12);
   QUEUE_FOR_EACH(&ifd->tags, elem, tmp) {
-    exif_tag_t* tag = (exif_tag_t*)elem;
+    exif_tag_t* tag = reinterpret_cast<exif_tag_t *>(elem);
     if (tag->size > 4) {
       uint32_t size = tag->size;
       if (size & 1) {
@@ -480,7 +480,7 @@ exif_read_ifd(exif_app_t* app, const uint16_t ifd_nr, gbsize_t offs,
   ifd->next_ifd = gbfgetuint32(fin);
 
   QUEUE_FOR_EACH(&ifd->tags, elem, tmp) {
-    exif_tag_t* tag = (exif_tag_t*)elem;
+    exif_tag_t* tag = reinterpret_cast<exif_tag_t *>(elem);
     if ((tag->size > 4) && (tag->value)) {
       tag->data = xmalloc(tag->size);
       tag->data_is_dynamic = 1;
@@ -611,7 +611,7 @@ exif_find_ifd(exif_app_t* app, const uint16_t ifd_nr)
   queue* e0, *t0;
 
   QUEUE_FOR_EACH(&app->ifds, e0, t0) {
-    exif_ifd_t* ifd = (exif_ifd_t*)e0;
+    exif_ifd_t* ifd = reinterpret_cast<exif_ifd_t *>(e0);
 
     if (ifd->nr == ifd_nr) {
       return ifd;
@@ -627,7 +627,7 @@ exif_find_tag(exif_app_t* app, const uint16_t ifd_nr, const uint16_t tag_id)
   if (ifd != nullptr) {
     queue* elem, *tmp;
     QUEUE_FOR_EACH(&ifd->tags, elem, tmp) {
-      exif_tag_t* tag = (exif_tag_t*)elem;
+      exif_tag_t* tag = reinterpret_cast<exif_tag_t *>(elem);
       if (tag->id == tag_id) {
         return tag;
       }
@@ -684,7 +684,7 @@ exif_waypt_from_exif_app(exif_app_t* app)
   wpt->longitude = unknown_alt;
 
   QUEUE_FOR_EACH(&ifd->tags, elem, tmp) {
-    tag = (exif_tag_t*)elem;
+    tag = reinterpret_cast<exif_tag_t *>(elem);
 
     switch (tag->id) {
     case GPS_IFD_TAG_VERSION:
@@ -1096,8 +1096,8 @@ exif_find_wpt_by_name(const Waypoint* wpt)
 static int
 exif_sort_tags_cb(const queue* A, const queue* B)
 {
-  exif_tag_t* ta = (exif_tag_t*)A;
-  exif_tag_t* tb = (exif_tag_t*)B;
+  const exif_tag_t* ta = reinterpret_cast<const exif_tag_t *>(A);
+  const exif_tag_t* tb = reinterpret_cast<const exif_tag_t *>(B);
 
   return ta->id - tb->id;
 }
@@ -1105,8 +1105,8 @@ exif_sort_tags_cb(const queue* A, const queue* B)
 static int
 exif_sort_ifds_cb(const queue* A, const queue* B)
 {
-  exif_ifd_t* ia = (exif_ifd_t*)A;
-  exif_ifd_t* ib = (exif_ifd_t*)B;
+  const exif_ifd_t* ia = reinterpret_cast<const exif_ifd_t *>(A);
+  const exif_ifd_t* ib = reinterpret_cast<const exif_ifd_t *>(B);
 
   return ia->nr - ib->nr;
 }
@@ -1143,7 +1143,7 @@ exif_write_ifd(const exif_ifd_t* ifd, const char next, gbfile* fout)
   gbsize_t offs = gbftell(fout) + (ifd->count * 12) + 4;
 
   QUEUE_FOR_EACH(&ifd->tags, elem, tmp) {
-    exif_tag_t* tag = (exif_tag_t*)elem;
+    exif_tag_t* tag = reinterpret_cast<exif_tag_t *>(elem);
 
     gbfputuint16(tag->id, fout);
     gbfputuint16(tag->type, fout);
@@ -1167,7 +1167,7 @@ exif_write_ifd(const exif_ifd_t* ifd, const char next, gbfile* fout)
   }
 
   QUEUE_FOR_EACH(&ifd->tags, elem, tmp) {
-    exif_tag_t* tag = (exif_tag_t*)elem;
+    exif_tag_t* tag = reinterpret_cast<exif_tag_t *>(elem);
 
     if (tag->size > 4) {
       char* ptr = (char*) tag->data;
@@ -1217,7 +1217,7 @@ exif_write_apps()
   gbfputuint16(0xFFD8, fout);
 
   QUEUE_FOR_EACH(&exif_apps, e0, t0) {
-    exif_app_t* app = (exif_app_t*)e0;
+    exif_app_t* app = reinterpret_cast<exif_app_t *>(e0);
 
     gbfputuint16(app->marker, fout);
 
@@ -1232,7 +1232,7 @@ exif_write_apps()
       sortqueue(&exif_app->ifds, exif_sort_ifds_cb);
 
       QUEUE_FOR_EACH(&app->ifds, e1, t1) {
-        exif_ifd_t* ifd = (exif_ifd_t*)e1;
+        exif_ifd_t* ifd = reinterpret_cast<exif_ifd_t *>(e1);
 
         if (ifd->nr == GPS_IFD) {
           exif_put_long(IFD0, IFD0_TAG_GPS_IFD_OFFS, 0, len);
@@ -1252,7 +1252,7 @@ exif_write_apps()
       }
 
       QUEUE_FOR_EACH(&app->ifds, e1, t1) {
-        exif_ifd_t* ifd = (exif_ifd_t*)e1;
+        exif_ifd_t* ifd = reinterpret_cast<exif_ifd_t *>(e1);
         sortqueue(&ifd->tags, exif_sort_tags_cb);
       }
 
@@ -1264,8 +1264,8 @@ exif_write_apps()
       gbfputuint32(0x08, ftmp);        /* offset to first IFD */
 
       QUEUE_FOR_EACH(&app->ifds, e1, t1) {
-        exif_ifd_t* ifd = (exif_ifd_t*)e1;
-        exif_ifd_t* ifd_next = (exif_ifd_t*)t1;
+        exif_ifd_t* ifd = reinterpret_cast<exif_ifd_t *>(e1);
+        exif_ifd_t* ifd_next = reinterpret_cast<exif_ifd_t *>(t1);
         char next;
 
         if ((ifd->nr == IFD0) && (ifd_next->nr == IFD1)) {
index 16060d47c19dd589aaaac845bcbed85eb07d48c6..0757d6e2e515ca98e95433ef7962e236fbf0e3e5 100644 (file)
--- a/garmin.cc
+++ b/garmin.cc
@@ -931,7 +931,7 @@ waypoint_prepare()
   foreach(Waypoint* wpt, waypt_list) {
 #else
   QUEUE_FOR_EACH(&waypt_head, elem, tmp) {
-    Waypoint* wpt = (Waypoint*) elem;
+    Waypoint* wpt = reinterpret_cast<Waypoint *>(elem);
 #endif
     char obuf[256];
 
index 9bb2c5852f53f8c244e0719db3f0b1bfc4836b52..f60092a04e9718fad501024bb3d87ab3fbc47afa 100644 (file)
@@ -766,8 +766,8 @@ write_string(const char* str, const char long_format)
 static int
 compare_wpt_cb(const queue* a, const queue* b)
 {
-  const Waypoint* wa = (Waypoint*) a;
-  const Waypoint* wb = (Waypoint*) b;
+  const Waypoint* wa = reinterpret_cast<const Waypoint *>(a);
+  const Waypoint* wb = reinterpret_cast<const Waypoint *>(b);
   return wa->shortname.compare(wb->shortname);
 }
 
@@ -794,7 +794,7 @@ wdata_free(writer_data_t* data)
   queue* elem, *tmp;
 
   QUEUE_FOR_EACH(&data->Q, elem, tmp) {
-    Waypoint* wpt = (Waypoint*)elem;
+    Waypoint* wpt = reinterpret_cast<Waypoint *>(elem);
 
     if (wpt->extra_data) {
       gpi_waypt_t* dt = (gpi_waypt_t*) wpt->extra_data;
@@ -852,7 +852,7 @@ wdata_check(writer_data_t* data)
 
   double center_lat = center_lon = 0;
   QUEUE_FOR_EACH(&data->Q, elem, tmp) {
-    Waypoint* wpt = (Waypoint*) elem;
+    Waypoint* wpt = reinterpret_cast<Waypoint *>(elem);
     center_lat += wpt->latitude;
     center_lon += wpt->longitude;
   }
@@ -860,7 +860,7 @@ wdata_check(writer_data_t* data)
   center_lon /= data->ct;
 
   QUEUE_FOR_EACH(&data->Q, elem, tmp) {
-    Waypoint* wpt = (Waypoint*) elem;
+    Waypoint* wpt = reinterpret_cast<Waypoint *>(elem);
     writer_data_t** ref;
 
     if (wpt->latitude < center_lat) {
@@ -915,7 +915,7 @@ wdata_compute_size(writer_data_t* data)
   res = 23;    /* bounds, ... of tag 0x80008 */
 
   QUEUE_FOR_EACH(&data->Q, elem, tmp) {
-    Waypoint* wpt = (Waypoint*) elem;
+    Waypoint* wpt = reinterpret_cast<Waypoint *>(elem);
     garmin_fs_t* gmsd;
 
     res += 12;         /* tag/sz/sub-sz */
@@ -1081,7 +1081,7 @@ wdata_write(const writer_data_t* data)
 
   QUEUE_FOR_EACH(&data->Q, elem, tmp) {
     int s1;
-    Waypoint* wpt = (Waypoint*)elem;
+    Waypoint* wpt = reinterpret_cast<Waypoint *>(elem);
     gpi_waypt_t* dt = (gpi_waypt_t*) wpt->extra_data;
 
     QString str = wpt->description;
@@ -1268,7 +1268,7 @@ enum_waypt_cb(const Waypoint* ref)
   queue* elem, *tmp;
 
   QUEUE_FOR_EACH(&wdata->Q, elem, tmp) {
-    Waypoint* cmp = (Waypoint*) elem;
+    Waypoint* cmp = reinterpret_cast<Waypoint *>(elem);
 
     /* sort out nearly equal waypoints */
     if ((compare_strings(cmp->shortname, ref->shortname) == 0) &&
diff --git a/gdb.cc b/gdb.cc
index bd54c2c530241d8a40d6675c8e62c8e46825fe59..ad768571ae2bea329ce6237687613f950511e0cf 100644 (file)
--- a/gdb.cc
+++ b/gdb.cc
@@ -100,7 +100,7 @@ gdb_flush_waypt_queue(queue* Q)
   queue* elem, *tmp;
 
   QUEUE_FOR_EACH(Q, elem, tmp) {
-    Waypoint* wpt = (Waypoint*)elem;
+    Waypoint* wpt = reinterpret_cast<Waypoint *>(elem);
     dequeue(elem);
     if (wpt->extra_data) {
 #if NEW_STRINGS
@@ -289,7 +289,7 @@ gdb_find_wayptq(const queue* Q, const Waypoint* wpt, const char exact)
   QString name = wpt->shortname;
 
   QUEUE_FOR_EACH(Q, elem, tmp) {
-    Waypoint* tmp = (Waypoint*)elem;
+    Waypoint* tmp = reinterpret_cast<Waypoint *>(elem);
     if (name.compare(tmp->shortname,Qt::CaseInsensitive) == 0) {
       if (! exact) {
         return tmp;
@@ -1395,7 +1395,7 @@ route_compute_bounds(const route_head* rte, bounds* bounds)
   queue* elem, *tmp;
   waypt_init_bounds(bounds);
   QUEUE_FOR_EACH((queue*)&rte->waypoint_list, elem, tmp) {
-    Waypoint* wpt = (Waypoint*)elem;
+    Waypoint* wpt = reinterpret_cast<Waypoint *>(elem);
     gdb_check_waypt(wpt);
     waypt_add_to_bounds(bounds, wpt);
   }
@@ -1440,8 +1440,8 @@ write_route(const route_head* rte, const QString& rte_name)
 
   QUEUE_FOR_EACH((queue*)&rte->waypoint_list, elem, tmp) {
 
-    Waypoint* wpt = (Waypoint*)elem;
-    Waypoint* next = (Waypoint*)tmp;
+    Waypoint* wpt = reinterpret_cast<Waypoint *>(elem);
+    Waypoint* next = reinterpret_cast<Waypoint *>(tmp);
 
     index++;
     rtept_ct++;        /* increase informational number of written route points */
@@ -1542,7 +1542,7 @@ write_track(const route_head* trk, const QString& trk_name)
   FWRITE_i32(points);  /* total number of waypoints in waypoint list */
 
   QUEUE_FOR_EACH((queue*)&trk->waypoint_list, elem, tmp) {
-    Waypoint* wpt = (Waypoint*)elem;
+    Waypoint* wpt = reinterpret_cast<Waypoint *>(elem);
 
     trkpt_ct++;        /* increase informational number of written route points */
 
index b2317f776e5478ddc0f5f4f8303991f4aeed24c8..0806a41b0c136cd7c81889f82d1e7ca857f58cf1 100644 (file)
@@ -202,7 +202,7 @@ ggv_log_track_head_cb(const route_head* trk)
   QUEUE_FOR_EACH((queue*)&trk->waypoint_list, elem, tmp) {
     double  course = 0, speed = 0;
     struct tm tm;
-    Waypoint* wpt = (Waypoint*)elem;
+    Waypoint* wpt = reinterpret_cast<Waypoint *>(elem);
     double secs = 0;
 
     int latint = wpt->latitude;
index a1d108012c23ae5cc379bb2dc423767fb5c576fd..263addefb04f9cea2b9d810450f9780fe610c8ef 100644 (file)
@@ -283,7 +283,7 @@ track_disp_cb(const route_head* trk)
 
   QUEUE_FOR_EACH(&(trk->waypoint_list), elem, tmp) {
 
-    Waypoint* wpt = (Waypoint*) elem;
+    Waypoint* wpt = reinterpret_cast<Waypoint *>(elem);
 
     gbfprintf(fout, "XKoord%d=%0.8f\n", i, wpt->longitude);
     gbfprintf(fout, "YKoord%d=%0.8f\n", i, wpt->latitude);
@@ -313,7 +313,7 @@ route_disp_cb(const route_head* rte)
 
   QUEUE_FOR_EACH(&(rte->waypoint_list), elem, tmp) {
 
-    Waypoint* wpt = (Waypoint*) elem;
+    Waypoint* wpt = reinterpret_cast<Waypoint *>(elem);
 
     if (prev != nullptr) {
       draw_symbol_basics(OVL_SYMBOL_TRIANGLE, 1, (OVL_COLOR_TYP)9 /* color */, prev);
diff --git a/gpx.cc b/gpx.cc
index eb4d84f39618f78114ca28abb73117245e337b88..0031080fc11ac6ea49b2bf8d99207c756c0167b0 100644 (file)
--- a/gpx.cc
+++ b/gpx.cc
@@ -223,7 +223,7 @@ gpx_rm_from_global(gpx_global_entry* ge)
   queue* elem, *tmp;
 
   QUEUE_FOR_EACH(&ge->queue, elem, tmp) {
-    gpx_global_entry* g = (gpx_global_entry*) dequeue(elem);
+    gpx_global_entry* g = reinterpret_cast<gpx_global_entry *>(dequeue(elem));
     xfree(g->tagdata);
     xfree(g);
   }
diff --git a/gtm.cc b/gtm.cc
index 3da5e69dfbf2ea990f196e5c578d517e34944c49..8360109189caac03181702831b84f0b3d3908fa1 100644 (file)
--- a/gtm.cc
+++ b/gtm.cc
@@ -588,7 +588,7 @@ gtm_read()
   for (i = 0; i != ts_count && i != real_tr_count; i++) {
     trk_head->rte_name = fread_string(file_in);
     fread_discard(file_in, 12);
-    trk_head = (route_head*)QUEUE_NEXT(&trk_head->Q);
+    trk_head = reinterpret_cast<route_head *>QUEUE_NEXT(&trk_head->Q);
   }
 
   /* Routes */
diff --git a/igc.cc b/igc.cc
index a3216935bf81eb30266cb5440743896b34864362..2bccfaf51ba33ff4911b200200a20e7b7dc10021 100644 (file)
--- a/igc.cc
+++ b/igc.cc
@@ -4,7 +4,7 @@
  * Refer to Appendix 1 of
  * http://www.fai.org:81/gliding/gnss/tech_spec_gnss.asp for the
  * specification of the IGC data format.  This translation code was
- * written when the latest ammendment list for the specification was AL6.
+ * written when the latest amendment list for the specification was AL6.
  *
  * Copyright (C) 2004 Chris Jones
  *
@@ -533,8 +533,8 @@ static char* latlon2str(const Waypoint* wpt)
   static char str[18] = "";
   // We use lround here because it:
   // "Returns the integral value that is nearest to x, with halfway cases rounded away from zero."
-  // The halfway rounding cases of *printf are not precisely defined, and can vary with implmentation.
-  // We don't really care which way the halfway cases go, but we want them to go that way consistenly
+  // The halfway rounding cases of *printf are not precisely defined, and can vary with implementation.
+  // We don't really care which way the halfway cases go, but we want them to go that way consistently
   // across implementations.
   // We also try to use a minimum of floating point arithmetic to minimize accumulated fp math errors.
   long lat_milliminutes = lround(wpt->latitude * 60000.0);
@@ -590,7 +590,7 @@ static void wr_header()
   }
   // Date in header record is that of the first fix record
   date = !track ? current_time().toTime_t() :
-         ((Waypoint*) QUEUE_FIRST(&track->waypoint_list))->GetCreationTime().toTime_t();
+         (reinterpret_cast<Waypoint *>QUEUE_FIRST(&track->waypoint_list))->GetCreationTime().toTime_t();
 
   if (nullptr == (tm = gmtime(&date))) {
     fatal(MYNAME ": Bad track timestamp\n");
@@ -662,11 +662,11 @@ static void wr_task_hdr(const route_head* rte)
   }
   // See if the takeoff and landing waypoints are there or if we need to
   // generate them.
-  const Waypoint* wpt = (Waypoint*) QUEUE_LAST(&rte->waypoint_list);
+  const Waypoint* wpt = reinterpret_cast<Waypoint *>QUEUE_LAST(&rte->waypoint_list);
   if (wpt->shortname.startsWith("LANDING")) {
     num_tps--;
   }
-  wpt = (Waypoint*) QUEUE_FIRST(&rte->waypoint_list);
+  wpt = reinterpret_cast<Waypoint *>QUEUE_FIRST(&rte->waypoint_list);
   if (wpt->shortname.startsWith("TAKEOFF")) {
     have_takeoff = 1;
     num_tps--;
@@ -704,7 +704,7 @@ static void wr_task_wpt(const Waypoint* wpt)
 static void wr_task_tlr(const route_head* rte)
 {
   // If the landing waypoint is not supplied we need to generate it.
-  const Waypoint* wpt = (Waypoint*) QUEUE_LAST(&rte->waypoint_list);
+  const Waypoint* wpt = reinterpret_cast<Waypoint *>QUEUE_LAST(&rte->waypoint_list);
   QString sn = wpt->shortname;
 //  if (!wpt->shortname || strncmp(wpt->shortname, "LANDIN", 6) != 0) {
   if (sn.isEmpty() || !sn.startsWith("LANDIN")) {
@@ -742,7 +742,7 @@ static void wr_fix_record(const Waypoint* wpt, int pres_alt, int gnss_alt)
 /**
  * Attempt to align the pressure and GNSS tracks in time.
  * This is useful when trying to merge a track (lat/lon/time) recorded by a
- * GPS with a barograph (alt/time) recorded by a seperate instrument with
+ * GPS with a barograph (alt/time) recorded by a separate instrument with
  * independent clocks which are not closely synchronised.
  * @return The number of seconds to add to the GNSS track in order to align
  *         it with the pressure track.
@@ -758,44 +758,44 @@ static int correlate_tracks(const route_head* pres_track, const route_head* gnss
   // Deduce the landing time from the pressure altitude track based on
   // when we last descended to within 10m of the final track altitude.
   const queue* elem = QUEUE_LAST(&pres_track->waypoint_list);
-  double last_alt = ((Waypoint*) elem)->altitude;
+  double last_alt = (reinterpret_cast<const Waypoint *>(elem))->altitude;
   do {
     elem = elem->prev;
     if (&pres_track->waypoint_list == elem) {
       // No track left
       return 0;
     }
-    alt_diff = last_alt - ((Waypoint*) elem)->altitude;
+    alt_diff = last_alt - (reinterpret_cast<const Waypoint *>(elem))->altitude;
     if (alt_diff > 10.0) {
       // Last part of track was ascending
       return 0;
     }
   } while (alt_diff > -10.0);
-  pres_time = ((Waypoint*) elem->next)->GetCreationTime().toTime_t();
+  pres_time = (reinterpret_cast<Waypoint *>(elem->next))->GetCreationTime().toTime_t();
   if (global_opts.debug_level >= 1) {
     printf(MYNAME ": pressure landing time %s", ctime(&pres_time));
   }
   // Deduce the landing time from the GNSS altitude track based on
   // when the groundspeed last dropped below a certain level.
   elem = QUEUE_LAST(&gnss_track->waypoint_list);
-  last_alt = ((Waypoint*) elem)->altitude;
+  last_alt = (reinterpret_cast<const Waypoint *>(elem))->altitude;
   do {
-    const Waypoint* wpt = (Waypoint*) elem;
+    const Waypoint* wpt = reinterpret_cast<const Waypoint *>(elem);
     elem = elem->prev;
     if (&gnss_track->waypoint_list == elem) {
       // No track left
       return 0;
     }
     // Get a crude indication of groundspeed from the change in lat/lon
-    time_diff = wpt->GetCreationTime().toTime_t() - ((Waypoint*) elem)->GetCreationTime().toTime_t();
+    time_diff = wpt->GetCreationTime().toTime_t() - (reinterpret_cast<const Waypoint *>(elem))->GetCreationTime().toTime_t();
     speed = !time_diff ? 0 :
-            (fabs(wpt->latitude - ((Waypoint*) elem)->latitude) +
-             fabs(wpt->longitude - ((Waypoint*) elem)->longitude)) / time_diff;
+            (fabs(wpt->latitude - (reinterpret_cast<const Waypoint *>(elem))->latitude) +
+             fabs(wpt->longitude - (reinterpret_cast<const Waypoint *>(elem))->longitude)) / time_diff;
     if (global_opts.debug_level >= 2) {
       printf(MYNAME ": speed=%f\n", speed);
     }
   } while (speed < 0.00003);
-  gnss_time = ((Waypoint*) elem->next)->GetCreationTime().toTime_t();
+  gnss_time = (reinterpret_cast<Waypoint *>(elem->next))->GetCreationTime().toTime_t();
   if (global_opts.debug_level >= 1) {
     printf(MYNAME ": gnss landing time %s", ctime(&gnss_time));
   }
@@ -823,7 +823,7 @@ static double interpolate_alt(const route_head* track, time_t time)
     curr_elem = prev_elem = QUEUE_FIRST(&track->waypoint_list);
   }
   // Find the track points either side of the requested time
-  while (((Waypoint*) curr_elem)->GetCreationTime().toTime_t() < time) {
+  while ((reinterpret_cast<const Waypoint *>(curr_elem))->GetCreationTime().toTime_t() < time) {
     if (QUEUE_LAST(&track->waypoint_list) == curr_elem) {
       // Requested time later than all track points, we can't interpolate
       return unknown_alt;
@@ -832,8 +832,8 @@ static double interpolate_alt(const route_head* track, time_t time)
     curr_elem = QUEUE_NEXT(prev_elem);
   }
 
-  const Waypoint* prev_wpt = (Waypoint*) prev_elem;
-  const Waypoint* curr_wpt = (Waypoint*) curr_elem;
+  const Waypoint* prev_wpt = reinterpret_cast<const Waypoint *>(prev_elem);
+  const Waypoint* curr_wpt = reinterpret_cast<const Waypoint *>(curr_elem);
 
   if (QUEUE_FIRST(&track->waypoint_list) == curr_elem) {
     if (curr_wpt->GetCreationTime().toTime_t() == time) {
@@ -854,7 +854,7 @@ static double interpolate_alt(const route_head* track, time_t time)
 }
 
 /*
- * Pressure altitude and GNSS altitude may be provided in two seperate
+ * Pressure altitude and GNSS altitude may be provided in two separate
  * tracks.  This function attempts to merge them into one.
  */
 static void wr_track()
index 831ee9e48a39da5a9a62464ab090fc13a7d64d7c..8885d8d165507ad600f70662f296efeca5c4d6bd 100644 (file)
@@ -176,13 +176,13 @@ inifile_find_value(const inifile_t* inifile, const char* sec_name, const char* k
   }
 
   QUEUE_FOR_EACH(&inifile->secs, elem, tmp) {
-    inifile_section_t* sec = (inifile_section_t*) elem;
+    inifile_section_t* sec = reinterpret_cast<inifile_section_t *>(elem);
 
     if (case_ignore_strcmp(sec->name, sec_name) == 0) {
       queue* elem, *tmp;
 
       QUEUE_FOR_EACH(&sec->entries, elem, tmp) {
-        inifile_entry_t* entry = (inifile_entry_t*) elem;
+        inifile_entry_t* entry = reinterpret_cast<inifile_entry_t *>(elem);
 
         if (case_ignore_strcmp(entry->key, key) == 0) {
           return entry->val;
@@ -235,13 +235,13 @@ inifile_done(inifile_t* inifile)
     queue* elem, *tmp;
 
     QUEUE_FOR_EACH(&inifile->secs, elem, tmp) {
-      inifile_section_t* sec = (inifile_section_t*) elem;
+      inifile_section_t* sec = reinterpret_cast<inifile_section_t *>(elem);
 
       if (sec->ientries > 0) {
         queue* elem, *tmp;
 
         QUEUE_FOR_EACH(&sec->entries, elem, tmp) {
-          inifile_entry_t* entry = (inifile_entry_t*) elem;
+          inifile_entry_t* entry = reinterpret_cast<inifile_entry_t *>(elem);
 
           if (entry->key) {
             xfree(entry->key);
@@ -270,7 +270,7 @@ inifile_has_section(const inifile_t* inifile, const char* section)
   queue* elem, *tmp;
 
   QUEUE_FOR_EACH(&inifile->secs, elem, tmp) {
-    inifile_section_t* sec = (inifile_section_t*) elem;
+    inifile_section_t* sec = reinterpret_cast<inifile_section_t *>(elem);
     if (case_ignore_strcmp(sec->name, section) == 0) {
       return 1;
     }
index e98beb50faaf3e09de976158cb092485ceddb97e..2b34c669d72e5dec6ccc7862c7f9d9842fe5e00a 100644 (file)
@@ -51,7 +51,7 @@ void InterpolateFilter::process()
   }
 
   QUEUE_FOR_EACH(backuproute, elem, tmp) {
-    route_head* rte_old = (route_head*)elem;
+    route_head* rte_old = reinterpret_cast<route_head *>(elem);
 
     route_head* rte_new = route_head_alloc();
     rte_new->rte_name = rte_old->rte_name;
@@ -65,7 +65,7 @@ void InterpolateFilter::process()
     }
     bool first = 1;
     QUEUE_FOR_EACH(&rte_old->waypoint_list, elem2, tmp2) {
-      Waypoint* wpt = (Waypoint*)elem2;
+      Waypoint* wpt = reinterpret_cast<Waypoint *>(elem2);
       if (first) {
         first = 0;
       } else {
diff --git a/kml.cc b/kml.cc
index 0f2fb650ca9fc1ce5a29ecbc1aecd9a690ec0fd1..2eed103d81c4a1933b0240e1ce0bb447f70c76c6 100644 (file)
--- a/kml.cc
+++ b/kml.cc
@@ -428,7 +428,7 @@ void trk_coord(xg_string args, const QXmlStreamAttributes*)
                   queue* curr_elem;
                   queue* tmp_elem;
                  QUEUE_FOR_EACH(&trk_head->waypoint_list, curr_elem, tmp_elem) {
-                         trkpt = (Waypoint*) curr_elem;
+                         trkpt = reinterpret_cast<Waypoint *>(curr_elem);
                          trkpt->SetCreationTime(wpt_timespan_begin);
                          wpt_timespan_begin = wpt_timespan_begin.addMSecs(ms_per_waypoint);
                  }
@@ -1071,7 +1071,7 @@ static void kml_output_tailer(const route_head* header)
     queue* elem, *tmp;
 
     QUEUE_FOR_EACH(&header->waypoint_list, elem, tmp) {
-      Waypoint* tpt = (Waypoint*) elem;
+      Waypoint* tpt = reinterpret_cast<Waypoint *>(elem);
       int first_in_trk = tpt->Q.prev == &header->waypoint_list;
       if (!first_in_trk && tpt->wpt_flags.new_trkseg) {
         needs_multigeometry = 1;
@@ -1108,7 +1108,7 @@ static void kml_output_tailer(const route_head* header)
     }
 
     QUEUE_FOR_EACH(&header->waypoint_list, elem, tmp) {
-      Waypoint* tpt = (Waypoint*) elem;
+      Waypoint* tpt = reinterpret_cast<Waypoint *>(elem);
       int first_in_trk = tpt->Q.prev == &header->waypoint_list;
       if (tpt->wpt_flags.new_trkseg) {
         if (!first_in_trk) {
@@ -1698,7 +1698,7 @@ static void kml_mt_simple_array(const route_head* header,
 
   QUEUE_FOR_EACH(&header->waypoint_list, elem, tmp) {
 
-    Waypoint* wpt = (Waypoint*) elem;
+    Waypoint* wpt = reinterpret_cast<Waypoint *>(elem);
 
     switch (member) {
     case fld_power:
@@ -1729,7 +1729,7 @@ static int track_has_time(const route_head* header)
   queue* elem, *tmp;
   int points_with_time = 0;
   QUEUE_FOR_EACH(&header->waypoint_list, elem, tmp) {
-    Waypoint* tpt = (Waypoint*)elem;
+    Waypoint* tpt = reinterpret_cast<Waypoint *>(elem);
 
     if (tpt->GetCreationTime().isValid()) {
       points_with_time++;
@@ -1747,7 +1747,7 @@ static void write_as_linestring(const route_head* header)
   queue* elem, *tmp;
   kml_track_hdr(header);
   QUEUE_FOR_EACH(&header->waypoint_list, elem, tmp) {
-    Waypoint* tpt = (Waypoint*)elem;
+    Waypoint* tpt = reinterpret_cast<Waypoint *>(elem);
     kml_track_disp(tpt);
   }
   kml_track_tlr(header);
@@ -1777,7 +1777,7 @@ static void kml_mt_hdr(const route_head* header)
   kml_output_positioning(false);
 
   QUEUE_FOR_EACH(&header->waypoint_list, elem, tmp) {
-    Waypoint* tpt = (Waypoint*)elem;
+    Waypoint* tpt = reinterpret_cast<Waypoint *>(elem);
 
     if (tpt->GetCreationTime().isValid()) {
       QString time_string = tpt->CreationTimeXML();
@@ -1790,7 +1790,7 @@ static void kml_mt_hdr(const route_head* header)
 
   // TODO: How to handle clamped, floating, extruded, etc.?
   QUEUE_FOR_EACH(&header->waypoint_list, elem, tmp) {
-    Waypoint* tpt = (Waypoint*)elem;
+    Waypoint* tpt = reinterpret_cast<Waypoint *>(elem);
 
     if (kml_altitude_known(tpt)) {
       writer->writeTextElement(QStringLiteral("gx:coord"),
@@ -2165,9 +2165,9 @@ kml_wr_position(Waypoint* wpt)
 
   /* In order to avoid clutter while we're sitting still, don't add
      track points if we've not moved a minimum distance from the
-     beginnning of our accumulated track. */
+     beginning of our accumulated track. */
   {
-    Waypoint* newest_posn= (Waypoint*) QUEUE_LAST(&posn_trk_head->waypoint_list);
+    Waypoint* newest_posn= reinterpret_cast<Waypoint *>QUEUE_LAST(&posn_trk_head->waypoint_list);
 
     if (radtometers(gcdist(RAD(wpt->latitude), RAD(wpt->longitude),
                            RAD(newest_posn->latitude), RAD(newest_posn->longitude))) > 50) {
@@ -2192,7 +2192,7 @@ kml_wr_position(Waypoint* wpt)
    */
   while (max_position_points &&
          (posn_trk_head->rte_waypt_ct >= max_position_points)) {
-    Waypoint* tonuke = (Waypoint*) QUEUE_FIRST(&posn_trk_head->waypoint_list);
+    Waypoint* tonuke = reinterpret_cast<Waypoint *>QUEUE_FIRST(&posn_trk_head->waypoint_list);
     track_del_wpt(posn_trk_head, tonuke);
   }
 
index 1b43e703a9364a645dcf55cd0eefcdfa3c145d08..1237dce8c6e980e0df502b6e217d27e72f484582 100644 (file)
@@ -474,7 +474,7 @@ lowranceusr4_find_waypt(int uid_unit, int uid_seq_low, int uid_seq_high)
   foreach(Waypoint* waypointp, waypt_list) {
 #else
   QUEUE_FOR_EACH(&waypt_head, elem, tmp) {
-    Waypoint* waypointp = (Waypoint*) elem;
+    Waypoint* waypointp = reinterpret_cast<Waypoint *>(elem);
 #endif
     fs = (lowranceusr4_fsdata*) fs_chain_find(waypointp->fs, FS_LOWRANCEUSR4);
 
index 8bb9777f6647eae1e3712564b8f3d39f88ebf9d4..1dbdbe0d3eb56c832ae7b41eae86a6bb8ccf56be 100644 (file)
@@ -1126,14 +1126,14 @@ mag_rteparse(char* rtemsg)
      */
 
     QUEUE_FOR_EACH(&mag_rte_head->Q, elem, tmp) {
-      mag_rte_elem* re = (mag_rte_elem*) elem;
+      mag_rte_elem* re = reinterpret_cast<mag_rte_elem *>(elem);
       queue* welem, *wtmp;
 
       /*
        * Copy route points from temp wpt queue.
        */
       QUEUE_FOR_EACH(&rte_wpt_tmp, welem, wtmp) {
-        Waypoint* waypt = (Waypoint*)welem;
+        Waypoint* waypt = reinterpret_cast<Waypoint *>(welem);
         if (waypt->shortname == re->wpt_name) {
           Waypoint* wpt = new Waypoint(*waypt);
           route_add_wpt(rte_head, wpt);
@@ -1490,7 +1490,7 @@ mag_route_trl(const route_head* rte)
 
   int thisline = i = 0;
   QUEUE_FOR_EACH(&rte->waypoint_list, elem, tmp) {
-    Waypoint* waypointp = (Waypoint*) elem;
+    Waypoint* waypointp = reinterpret_cast<Waypoint *>(elem);
     i++;
 
     if (deficon) {
index c6b370eb606461179ab5a3a003dab638d4125d59..651648204a237dd1af35faa00eb1e9674ec2fad4 100644 (file)
@@ -169,7 +169,7 @@ tr7_check_after_read_trailer_cb(const route_head* trk)
 {
   queue* elem, *tmp;
   QUEUE_FOR_EACH((queue*)&trk->waypoint_list, elem, tmp) {
-    Waypoint* wpt = (Waypoint*)elem;
+    Waypoint* wpt = reinterpret_cast<Waypoint *>(elem);
     if (speed_tmp == 0) {
       WAYPT_UNSET(wpt, speed);
     }
index 312bebc36cfd53e41ffa7071b1acd1036b6024b9..146eb2f0634a6a157766832afad42b0c3ad3a58a 100644 (file)
@@ -124,7 +124,7 @@ mps_wpt_q_deinit(queue* whichQueue)
   queue* elem, *tmp;
 
   QUEUE_FOR_EACH(whichQueue, elem, tmp) {
-    Waypoint* q = (Waypoint*) dequeue(elem);
+    Waypoint* q = reinterpret_cast<Waypoint *>(dequeue(elem));
     delete q;
   }
 }
@@ -1118,7 +1118,7 @@ mps_routehdr_w(gbfile* mps_file, int mps_ver, const route_head* rte)
 
   if (rte->waypoint_list.next) {               /* this test doesn't do what I want i.e test if this is a valid route - treat as a placeholder for now */
     QUEUE_FOR_EACH(&rte->waypoint_list, elem, tmp) {
-      Waypoint* testwpt = (Waypoint*)elem;
+      Waypoint* testwpt = reinterpret_cast<Waypoint *>(elem);
       if (rte_datapoints == 0) {
         uniqueValue = testwpt->GetCreationTime().toTime_t();
       }
@@ -1546,7 +1546,7 @@ mps_trackhdr_w(gbfile* mps_file, int mps_ver, const route_head* trk)
   if (trk->waypoint_list.next) {       /* this test doesn't do what I want i.e test if this is a valid track - treat as a placeholder for now */
     QUEUE_FOR_EACH(&trk->waypoint_list, elem, tmp) {
       if (trk_datapoints == 0) {
-        Waypoint* testwpt = (Waypoint*)elem;
+        Waypoint* testwpt = reinterpret_cast<Waypoint *>(elem);
         uniqueValue = testwpt->GetCreationTime().toTime_t();
       }
       trk_datapoints++;
index 773770ee339fe63000b6961ff1cbcbe2c6a7c455..99f0f1ab7d1debaa48abbcbc7c044d956d431143 100644 (file)
@@ -111,7 +111,7 @@ is_unique(mkshort_handle_imp* h, char* name)
 
   int hash = hash_string(name);
   QUEUE_FOR_EACH(&h->namelist[hash], e, t) {
-    uniq_shortname* z = (uniq_shortname*) e;
+    uniq_shortname* z = reinterpret_cast<uniq_shortname *>(e);
     if (0 == case_ignore_strcmp(z->orig_shortname, name)) {
       return z;
     }
@@ -167,7 +167,7 @@ mkshort_del_handle(short_handle* h)
   for (int i = 0; i < PRIME; i++) {
     queue* e, *t;
     QUEUE_FOR_EACH(&hdr->namelist[i], e, t) {
-      uniq_shortname* s = (uniq_shortname*) e;
+      uniq_shortname* s = reinterpret_cast<uniq_shortname *>(e);
 #if 0
       if (global_opts.verbose_status >= 2 && s->conflictctr) {
         fprintf(stderr, "%d Output name conflicts: '%s'\n",
diff --git a/mmo.cc b/mmo.cc
index b615a6e4d77dab23f546a98fe93705f1915ca736..7adb3e67591a07e4810dc5e6aa4cd62203593498 100644 (file)
--- a/mmo.cc
+++ b/mmo.cc
@@ -1279,7 +1279,7 @@ mmo_write_rte_head_cb(const route_head* rte)
   mmo_rte = rte;
 
   QUEUE_FOR_EACH(&rte->waypoint_list, elem, tmp) {
-    Waypoint* wpt = (Waypoint*)elem;
+    Waypoint* wpt = reinterpret_cast<Waypoint *>(elem);
     QDateTime t = wpt->GetCreationTime();
     if ((t.isValid()) && (t.toTime_t() < time)) {
       time = t.toTime_t();
@@ -1323,7 +1323,7 @@ mmo_write_rte_tail_cb(const route_head* rte)
   }
 
   QUEUE_FOR_EACH(&rte->waypoint_list, elem, tmp) {
-    Waypoint* wpt = (Waypoint*)elem;
+    Waypoint* wpt = reinterpret_cast<Waypoint *>(elem);
     int objid = mmo_get_objid(wpt);
     gbfputuint16(objid & 0x7FFF, fout);
   }
index 3b43f9d17d4c94601b8d1c5bf8ec369cda5af27d..4645f7ab4225e9e4fb7817de930e4b695a4f2f14 100644 (file)
@@ -308,7 +308,7 @@ fix_netstumbler_dupes()
   queue* elem, *tmp;
   extern queue waypt_head;
   QUEUE_FOR_EACH(&waypt_head, elem, tmp) {
-    bh->wpt = (Waypoint*) elem;
+    bh->wpt = reinterpret_cast<Waypoint *>(elem);
 #endif
     QString snptr = bh->wpt->shortname;
     QString tmp_sn = snptr.toLower();
diff --git a/nmea.cc b/nmea.cc
index 8a5ec431248642ea9a36755a122d4ef36ff784c2..f73deb26f63a7a9a100e51b35e84556b430366b8 100644 (file)
--- a/nmea.cc
+++ b/nmea.cc
@@ -841,7 +841,7 @@ pcmpt_parse(char* ibuf)
     route_head* trk_head = route_head_alloc();
     track_add_head(trk_head);
     QUEUE_FOR_EACH(&pcmpt_head, elem, tmp) {
-      Waypoint* wpt = (Waypoint*) dequeue(elem);
+      Waypoint* wpt = reinterpret_cast<Waypoint *>(dequeue(elem));
       nmea_add_wpt(wpt, trk_head);
     }
   }
@@ -867,7 +867,7 @@ nmea_fix_timestamps(route_head* track)
     time_t delta_tm = mkgmtime(&opt_tm);
 
     QUEUE_FOR_EACH(&track->waypoint_list, elem, temp) {
-      Waypoint* wpt = (Waypoint*)elem;
+      Waypoint* wpt = reinterpret_cast<Waypoint *>(elem);
 
       wpt->creation_time += delta_tm;
       if ((prev != nullptr) && (prev->creation_time > wpt->creation_time)) {
@@ -887,7 +887,7 @@ nmea_fix_timestamps(route_head* track)
     /* go backward through the track and complete timestamps */
 
     for (queue* elem = QUEUE_LAST(&track->waypoint_list); elem != &track->waypoint_list; elem=elem->prev) {
-      Waypoint* wpt = (Waypoint*)elem;
+      Waypoint* wpt = reinterpret_cast<Waypoint *>(elem);
 
       if (wpt->wpt_flags.fmt_use != 0) {
         wpt->wpt_flags.fmt_use = 0; /* reset flag */
index f844207639fcea353fc4a9ac601b386dbbb7128d..d45779cfd7f2216ca25a0558103236ed3243bc27 100644 (file)
@@ -65,8 +65,8 @@ static void
 rd_deinit()
 {
   if (route != nullptr) {
-    Waypoint* head = (Waypoint*) QUEUE_FIRST(&route->waypoint_list);
-    Waypoint* tail = (Waypoint*) QUEUE_LAST(&route->waypoint_list);
+    Waypoint* head = reinterpret_cast<Waypoint *>QUEUE_FIRST(&route->waypoint_list);
+    Waypoint* tail = reinterpret_cast<Waypoint *>QUEUE_LAST(&route->waypoint_list);
     if (head != nullptr) {
       route->rte_name = head->shortname;
     }
index 54b13f12f22bb6641dfdc05b26f725fc0b147801..75b0e77e19935b82f5c341ff3b188379fdd4a4ab 100644 (file)
@@ -252,7 +252,7 @@ void PolygonFilter::process()
       foreach (Waypoint* waypointp, waypt_list) {
 #else
       QUEUE_FOR_EACH(&waypt_head, elem, tmp) {
-        waypointp = (Waypoint*)elem;
+        waypointp = reinterpret_cast<Waypoint *>(elem);
 #endif
         if (waypointp->extra_data) {
           ed = (extra_data*) waypointp->extra_data;
@@ -301,7 +301,7 @@ void PolygonFilter::process()
   foreach (Waypoint* wp, waypt_list) {
 #else
   QUEUE_FOR_EACH(&waypt_head, elem, tmp) {
-    Waypoint* wp = (Waypoint*) elem;
+    Waypoint* wp = reinterpret_cast<Waypoint *>(elem);
 #endif
     ed = (extra_data*) wp->extra_data;
     wp->extra_data = nullptr;
index 035c130132c4ec0193d64448397238b4a1fe60b2..ea6cc94bffc3e74687c40abf5a3c31603f31aef8 100644 (file)
@@ -53,7 +53,7 @@ void PositionFilter::position_runqueue(queue* q, int nelems, int qtype)
     comp[i] = waypointp;
 #else
   QUEUE_FOR_EACH(q, elem, tmp) {
-    comp[i] = (Waypoint*)elem;
+    comp[i] = reinterpret_cast<Waypoint *>(elem);
 #endif
     qlist[i] = 0;
     i++;
index 17014d25a5432a61ddec1ea1cf71f1cef870afc6..d4f2c996de06f8b4fcf139dd0994c911db030546 100644 (file)
--- a/radius.cc
+++ b/radius.cc
@@ -67,7 +67,7 @@ void RadiusFilter::process()
   foreach (Waypoint* waypointp, waypt_list) {
 #else
   QUEUE_FOR_EACH(&waypt_head, elem, tmp) {
-    Waypoint* waypointp = (Waypoint*)elem;
+    Waypoint* waypointp = reinterpret_cast<Waypoint *>(elem);
 #endif
     double dist = gc_distance(waypointp->latitude,
                        waypointp->longitude,
@@ -105,7 +105,7 @@ void RadiusFilter::process()
   foreach (Waypoint* wp, waypt_list) {
 #else
   QUEUE_FOR_EACH(&waypt_head, elem, tmp) {
-    Waypoint* wp = (Waypoint*) elem;
+    Waypoint* wp = reinterpret_cast<Waypoint *>(elem);
 #endif
     comp[i] = wp;
     waypt_del(wp);
index 678cb5b5348db52460f3246656ecdcbc0ee27858..5348795ed3eebe83b7763e4e9a88e6797cc19914 100644 (file)
--- a/route.cc
+++ b/route.cc
@@ -135,7 +135,7 @@ common_route_by_name(queue* routes, const char* name)
   queue* elem, *tmp;
 
   QUEUE_FOR_EACH(routes, elem, tmp) {
-    route_head* rte = (route_head*) elem;
+    route_head* rte = reinterpret_cast<route_head *>(elem);
     if (rte->rte_name == name) {
       return rte;
     }
@@ -217,7 +217,7 @@ route_find_waypt_by_name(route_head* rh, const char* name)
   queue* elem, *tmp;
 
   QUEUE_FOR_EACH(&rh->waypoint_list, elem, tmp) {
-    Waypoint* waypointp = (Waypoint*) elem;
+    Waypoint* waypointp = reinterpret_cast<Waypoint *>(elem);
     if (waypointp->shortname == name) {
       return waypointp;
     }
@@ -228,8 +228,8 @@ route_find_waypt_by_name(route_head* rh, const char* name)
 static void
 any_route_del_wpt(route_head* rte, Waypoint* wpt, int* ct)
 {
-  if (wpt->wpt_flags.new_trkseg && wpt != (Waypoint*)QUEUE_LAST(&rte->waypoint_list)) {
-    Waypoint* wpt_next = (Waypoint*)QUEUE_NEXT(&wpt->Q);
+  if (wpt->wpt_flags.new_trkseg && wpt != reinterpret_cast<Waypoint *>QUEUE_LAST(&rte->waypoint_list)) {
+    Waypoint* wpt_next = reinterpret_cast<Waypoint *>QUEUE_NEXT(&wpt->Q);
     wpt_next->wpt_flags.new_trkseg = 1;
   }
   wpt->wpt_flags.new_trkseg = 0;
@@ -274,7 +274,7 @@ common_disp_session(const session_t* se, queue* qh, route_hdr rh, route_trl rt,
 {
   queue* elem, *tmp;
   QUEUE_FOR_EACH(qh, elem, tmp) {
-    const route_head* rhp = (route_head*) elem;
+    const route_head* rhp = reinterpret_cast<route_head *>(elem);
     if (rhp->session == se) {
       if (rh) {
         (*rh)(rhp);
@@ -306,7 +306,7 @@ route_flush_q(queue* head)
 
   QUEUE_FOR_EACH(head, elem, tmp) {
     queue* q = dequeue(elem);
-    any_route_free((route_head*) q);
+    any_route_free(reinterpret_cast<route_head *>(q));
   }
 }
 
@@ -339,7 +339,7 @@ route_flush(queue* head)
   queue* elem, *tmp;
   QUEUE_FOR_EACH(head, elem, tmp) {
     queue* q = dequeue(elem);
-    any_route_free((route_head*)q);
+    any_route_free(reinterpret_cast<route_head *>(q));
   }
 }
 
@@ -361,7 +361,7 @@ route_copy(int* dst_count, int* dst_wpt_count, queue** dst, queue* src)
 
   const char RPT[] = "RPT";
   QUEUE_FOR_EACH(src, elem, tmp) {
-    route_head* rte_old = (route_head*)elem;
+    route_head* rte_old = reinterpret_cast<route_head *>(elem);
 
     route_head* rte_new = route_head_alloc();
     rte_new->rte_name = rte_old->rte_name;
@@ -371,7 +371,7 @@ route_copy(int* dst_count, int* dst_wpt_count, queue** dst, queue* src)
     rte_new->rte_num = rte_old->rte_num;
     any_route_add_head(rte_new, *dst);
     QUEUE_FOR_EACH(&rte_old->waypoint_list, elem2, tmp2) {
-      any_route_add_wpt(rte_new, new Waypoint(*(Waypoint*)elem2), dst_wpt_count, 0, RPT, 3);
+      any_route_add_wpt(rte_new, new Waypoint(*reinterpret_cast<Waypoint *>(elem2)), dst_wpt_count, 0, RPT, 3);
     }
     (*dst_count)++;
   }
@@ -544,7 +544,7 @@ void track_recompute(const route_head* trk, computed_trkdata** trkdatap)
   tdata->max_alt =  unknown_alt;
 
   QUEUE_FOR_EACH((queue*)&trk->waypoint_list, elem, tmp) {
-    Waypoint* thisw = (Waypoint*)elem;
+    Waypoint* thisw = reinterpret_cast<Waypoint *>(elem);
 
     /*
      * gcdist and heading want radians, not degrees.
index e99fd1e91df6b1d730bccd552a290ecf642d3313..6afb27181d6c34af2ea655a224c7d90e3a5207b9 100644 (file)
@@ -40,7 +40,7 @@ session_exit()
   queue* elem, *tmp;
 
   QUEUE_FOR_EACH(&session_list, elem, tmp) {
-    session_t* s = (session_t*)elem;
+    session_t* s = reinterpret_cast<session_t *>(elem);
     dequeue(&s->Q);
     session_free(s);
   }
@@ -65,7 +65,7 @@ start_session(const char* name, const char* filename)
 session_t*
 curr_session()
 {
-  return (session_t*) session_list.prev;
+  return reinterpret_cast<session_t *>(session_list.prev);
 }
 
 /* in work
@@ -107,7 +107,7 @@ session_free(session_t* s)
 {
   queue* elem, *tmp;
   QUEUE_FOR_EACH(&s->category_list, elem, tmp) {
-    category_t* c = (category_t*) elem;
+    category_t* c = reinterpret_cast<category_t *>(elem);
     dequeue(&c->Q);
     xfree(c);
   }
diff --git a/sort.cc b/sort.cc
index 9c1d63449eb4e9fecee5176c1686fc60616a0d57..a50be2c73644ca074276070110c3a773a116676b 100644 (file)
--- a/sort.cc
+++ b/sort.cc
@@ -27,8 +27,8 @@
 
 int SortFilter::sort_comp(const queue* a, const queue* b)
 {
-  const Waypoint* x1 = (Waypoint*)a;
-  const Waypoint* x2 = (Waypoint*)b;
+  const Waypoint* x1 = reinterpret_cast<const Waypoint *>(a);
+  const Waypoint* x2 = reinterpret_cast<const Waypoint *>(b);
 
   switch (sort_mode)  {
   case sm_gcid:
index c1fea560cef9b2052d8290c0ad3c8f72d5d80e6a..9e79d3e22c77318c0c0d289a726acbf454e1b7ba 100644 (file)
@@ -45,7 +45,7 @@ void StackFilter::process()
     stack = tmp_elt;
     if (opt_copy) {
       QUEUE_FOR_EACH(&(stack->waypts), elem, tmp) {
-        waypt_add(new Waypoint(*(Waypoint*)elem));
+        waypt_add(new Waypoint(*reinterpret_cast<Waypoint *>(elem)));
       }
     }
 
@@ -72,7 +72,7 @@ void StackFilter::process()
     }
     if (opt_append) {
       QUEUE_FOR_EACH(&(stack->waypts), elem, tmp) {
-        waypt_add((Waypoint*)elem);
+        waypt_add(reinterpret_cast<Waypoint *>(elem));
       }
       route_append(&(stack->routes));
       route_flush(&(stack->routes));
index f48ffc15d57e3fbc6e35ee93ab686c4a6cf5e94a..e45aacd553d52bc1b7dd94e7b896eadcc75c1258 100644 (file)
--- a/stmsdf.cc
+++ b/stmsdf.cc
@@ -192,7 +192,7 @@ finalize_tracks(void)
 
   int index = 0;
   QUEUE_FOR_EACH(&trackpts, elem, tmp) {
-    list[index] = (Waypoint*)elem;
+    list[index] = reinterpret_cast<Waypoint *>(elem);
     dequeue(elem);
     index++;
   }
index 94c0d7c45c2a0c18c9d5376bfbcabf2e32182e06..70830787fc588932ec5c145ed22b4e884a7b2db5 100644 (file)
--- a/tomtom.cc
+++ b/tomtom.cc
@@ -443,7 +443,7 @@ data_write()
   foreach(Waypoint* waypointp, waypt_list) {
 #else
   QUEUE_FOR_EACH(&waypt_head, elem, tmp) {
-    Waypoint* waypointp = (Waypoint*) elem;
+    Waypoint* waypointp = reinterpret_cast<Waypoint *>(elem);
 #endif
     bh->wpt = waypointp;
     if (waypointp->longitude > maxlon) {
diff --git a/tpo.cc b/tpo.cc
index 91d082d9e3750ec051ce4309ccc87df31bad54f9..54d04f6c185f2327c55a74d086973f0362950fd2 100644 (file)
--- a/tpo.cc
+++ b/tpo.cc
@@ -1616,7 +1616,7 @@ tpo_track_hdr(const route_head* rte)
   unsigned char unknown1[] = { 0xFF, 0x00, 0x00, 0x00 };
   unsigned char bounding_box[8] = { 0x00, 0x80, 0x00, 0x80, 0xFF, 0x7F, 0xFF, 0x7F };
 
-  Waypoint* first_track_waypoint = (Waypoint*) QUEUE_FIRST(&rte->waypoint_list);
+  Waypoint* first_track_waypoint = reinterpret_cast<Waypoint *>QUEUE_FIRST(&rte->waypoint_list);
 
   /* zoom level 1-5 visibility flags */
   gbfwrite(visibility_flags, 1, sizeof(visibility_flags), tpo_file_out);
index 7a0543e46e82fa5a6311866272914cd555b45d2d..dedefae3773b4f39473f22966a471f5f6216d0cb 100644 (file)
@@ -184,7 +184,7 @@ void TrackFilter::trackfilter_fill_track_list_cb(const route_head* track)   /* ca
   if (opt_name != nullptr) {
     if (!QRegExp(opt_name, Qt::CaseInsensitive, QRegExp::WildcardUnix).exactMatch(track->rte_name)) {
       QUEUE_FOR_EACH((queue*)&track->waypoint_list, elem, tmp) {
-        Waypoint* wpt = (Waypoint*)elem;
+        Waypoint* wpt = reinterpret_cast<Waypoint *>(elem);
         track_del_wpt(const_cast<route_head*>(track), wpt);
         delete wpt;
       }
@@ -201,7 +201,7 @@ void TrackFilter::trackfilter_fill_track_list_cb(const route_head* track)   /* ca
   QUEUE_FOR_EACH((queue*)&track->waypoint_list, elem, tmp) {
     track_pts++;
 
-    Waypoint* wpt = (Waypoint*)elem;
+    Waypoint* wpt = reinterpret_cast<Waypoint *>(elem);
     if (!wpt->creation_time.isValid()) {
       timeless_pts++;
     }
@@ -280,7 +280,7 @@ void TrackFilter::trackfilter_pack_init_rte_name(route_head* track, const time_t
     if (track->rte_waypt_ct == 0) {
       tm = *localtime(&default_time);
     } else {
-      Waypoint* wpt = (Waypoint*) QUEUE_FIRST((queue*)&track->waypoint_list);
+      Waypoint* wpt = reinterpret_cast<Waypoint *>QUEUE_FIRST((queue*)&track->waypoint_list);
       time_t t = wpt->GetCreationTime().toTime_t();
       tm = *localtime(&t);
     }
@@ -337,7 +337,7 @@ void TrackFilter::trackfilter_pack()
     route_head* curr = track_list[i].track;
 
     QUEUE_FOR_EACH((queue*)&curr->waypoint_list, elem, tmp) {
-      Waypoint* wpt = (Waypoint*)elem;
+      Waypoint* wpt = reinterpret_cast<Waypoint *>(elem);
       track_del_wpt(curr, wpt);
       track_add_wpt(master, wpt);
     }
@@ -369,7 +369,7 @@ void TrackFilter::trackfilter_merge()
   for (i = 0; i < track_ct; i++) {     /* put all points into temp buffer */
     route_head* track = track_list[i].track;
     QUEUE_FOR_EACH((queue*)&track->waypoint_list, elem, tmp) {
-      wpt = (Waypoint*)elem;
+      wpt = reinterpret_cast<Waypoint *>(elem);
       if (wpt->creation_time.isValid()) {
         buff[j] = new Waypoint(*wpt);
         // augment sort key so a stable sort is possible.
@@ -536,7 +536,7 @@ void TrackFilter::trackfilter_split()
 
   i = 0;
   QUEUE_FOR_EACH((queue*)&master->waypoint_list, elem, tmp) {
-    wpt = (Waypoint*)elem;
+    wpt = reinterpret_cast<Waypoint *>(elem);
     buff[i++] = wpt;
   }
 
@@ -627,7 +627,7 @@ void TrackFilter::trackfilter_move()
   for (int i = 0; i < track_ct; i++) {
     route_head* track = track_list[i].track;
     QUEUE_FOR_EACH((queue*)&track->waypoint_list, elem, tmp) {
-      Waypoint* wpt = (Waypoint*)elem;
+      Waypoint* wpt = reinterpret_cast<Waypoint *>(elem);
       wpt->creation_time += delta;
     }
 
@@ -657,7 +657,7 @@ void TrackFilter::trackfilter_synth()
     route_head* track = track_list[i].track;
     int first = 1;
     QUEUE_FOR_EACH((queue*)&track->waypoint_list, elem, tmp) {
-      Waypoint* wpt = (Waypoint*)elem;
+      Waypoint* wpt = reinterpret_cast<Waypoint *>(elem);
       if (opt_fix) {
         wpt->fix = fix;
         if (wpt->sat == 0) {
@@ -771,7 +771,7 @@ int TrackFilter::trackfilter_range()                /* returns number of track points left aft
     route_head* track = track_list[i].track;
 
     QUEUE_FOR_EACH((queue*)&track->waypoint_list, elem, tmp) {
-      Waypoint* wpt = (Waypoint*)elem;
+      Waypoint* wpt = reinterpret_cast<Waypoint *>(elem);
       if (wpt->creation_time.isValid()) {
         inside = ((wpt->GetCreationTime().toTime_t() >= start) && (wpt->GetCreationTime().toTime_t() <= stop));
       }
@@ -815,7 +815,7 @@ void TrackFilter::trackfilter_seg2trk()
     int trk_seg_num = 1, first = 1;
 
     QUEUE_FOR_EACH((queue*)&src->waypoint_list, elem, tmp) {
-      Waypoint* wpt = (Waypoint*)elem;
+      Waypoint* wpt = reinterpret_cast<Waypoint *>(elem);
       if (wpt->wpt_flags.new_trkseg && !first) {
 
         dest = route_head_alloc();
@@ -862,7 +862,7 @@ void TrackFilter::trackfilter_trk2seg()
 
     int first = 1;
     QUEUE_FOR_EACH((queue*)&curr->waypoint_list, elem, tmp) {
-      Waypoint* wpt = (Waypoint*)elem;
+      Waypoint* wpt = reinterpret_cast<Waypoint *>(elem);
 
 
       int orig_new_trkseg = wpt->wpt_flags.new_trkseg;
@@ -951,7 +951,7 @@ void TrackFilter::trackfilter_faketime()
     route_head* track = track_list[i].track;
 
     QUEUE_FOR_EACH((queue*)&track->waypoint_list, elem, tmp) {
-      Waypoint* wpt = (Waypoint*)elem;
+      Waypoint* wpt = reinterpret_cast<Waypoint *>(elem);
 
       if (!wpt->creation_time.isValid() || faketime.force) {
         wpt->creation_time = QDateTime::fromTime_t(faketime.start);
@@ -995,7 +995,7 @@ void TrackFilter::trackfilter_segment_head(const route_head* rte)
   const double ktoo_close = 0.000005;
 
   QUEUE_FOR_EACH(&rte->waypoint_list, elem, tmp) {
-    Waypoint* wpt = (Waypoint*)elem;
+    Waypoint* wpt = reinterpret_cast<Waypoint *>(elem);
     if (index > 0) {
       double cur_dist = gcdist(RAD(prev_wpt->latitude),
                                RAD(prev_wpt->longitude),
@@ -1007,8 +1007,8 @@ void TrackFilter::trackfilter_segment_head(const route_head* rte)
       }
 
       if (cur_dist < ktoo_close) {
-        if (wpt != (Waypoint*) QUEUE_LAST(&rte->waypoint_list)) {
-          Waypoint* next_wpt = (Waypoint*) QUEUE_NEXT(&wpt->Q);
+        if (wpt != reinterpret_cast<Waypoint *>QUEUE_LAST(&rte->waypoint_list)) {
+          Waypoint* next_wpt = reinterpret_cast<Waypoint *>QUEUE_NEXT(&wpt->Q);
           if (trackfilter_points_are_same(prev_wpt, wpt) &&
               trackfilter_points_are_same(wpt, next_wpt)) {
             track_del_wpt(const_cast<route_head*>(rte), wpt);
index 8206282150bae9bc03c00b0493b1028d7830a89e..e5d563f70b76fd36445749ae9040a0c3edf97e59 100644 (file)
@@ -47,7 +47,7 @@ void TransformFilter::transform_waypoints()
 #else
   queue* elem, *tmp;
   QUEUE_FOR_EACH(&waypt_head, elem, tmp) {
-    Waypoint* wpt = (Waypoint*) elem;
+    Waypoint* wpt = reinterpret_cast<Waypoint *>(elem);
 #endif
 
     wpt = new Waypoint(*wpt);
index ff945a22bfd92fd250c52d9e6c8c95831135efc9..2015b841f4e932b5295e0bbc7b897b9004895c8e 100644 (file)
--- a/waypt.cc
+++ b/waypt.cc
@@ -260,7 +260,7 @@ waypt_compute_bounds(bounds* bounds)
 #else
   queue* elem, *tmp;
   QUEUE_FOR_EACH(&waypt_head, elem, tmp) {
-    Waypoint* waypointp = (Waypoint*) elem;
+    Waypoint* waypointp = reinterpret_cast<Waypoint *>(elem);
 #endif
     waypt_add_to_bounds(bounds, waypointp);
   }
@@ -275,7 +275,7 @@ find_waypt_by_name(const QString& name)
   queue* elem, *tmp;
 
   QUEUE_FOR_EACH(&waypt_head, elem, tmp) {
-    Waypoint* waypointp = (Waypoint*) elem;
+    Waypoint* waypointp = reinterpret_cast<Waypoint *>(elem);
 #endif
     if (waypointp->shortname == name) {
       return waypointp;
@@ -308,7 +308,7 @@ waypt_flush(queue* head)
   queue* elem, *tmp;
 
   QUEUE_FOR_EACH(head, elem, tmp) {
-    Waypoint* q = (Waypoint*) dequeue(elem);
+    Waypoint* q = reinterpret_cast<Waypoint *>(dequeue(elem));
     delete q;
     if (head == &waypt_head) {
       waypt_ct--;
@@ -351,7 +351,7 @@ waypt_backup(signed int* count, queue** head_bak)
   waypt_ct = 0;
 
   QUEUE_FOR_EACH(qbackup, elem, tmp) {
-    wpt = (Waypoint*)elem;
+    wpt = reinterpret_cast<Waypoint *>(elem);
     waypt_add(new Waypoint(*wpt));
     no++;
   }
diff --git a/xcsv.cc b/xcsv.cc
index 7ab6db41f04ec8bcc53e3493974b63b6d5e75260..5e68feda5617f5c86e350f72f4670aa5ba24459c 100644 (file)
--- a/xcsv.cc
+++ b/xcsv.cc
@@ -126,7 +126,7 @@ xcsv_destroy_style(void)
 
   /* destroy the ifields */
   QUEUE_FOR_EACH(&xcsv_file.ifield, elem, tmp) {
-    fmp = (field_map_t*) elem;
+    fmp = reinterpret_cast<field_map_t *>(elem);
     if (fmp->key) {
       xfree(fmp->key);
     }
@@ -144,7 +144,7 @@ xcsv_destroy_style(void)
   /* destroy the ofields, if they are not re-mapped to ifields. */
   if (xcsv_file.ofield != &xcsv_file.ifield) {
     QUEUE_FOR_EACH(xcsv_file.ofield, elem, tmp) {
-      fmp = (field_map_t*) elem;
+      fmp = reinterpret_cast<field_map_t *>(elem);
       if (fmp->key) {
         xfree(fmp->key);
       }